<?php

    require_once("includes/common.inc.php");

//    Timer::Start("page_load", $_SERVER['QUERY_STRING']);

    $query = GetRedirectQuery( $_SERVER['QUERY_STRING'] );

    Redirect::HandleRequest( $query );

    function GetRedirectQuery( $query )
    {
        $result = null;
        if ( strpos($query, 'path=') === 0 )
        {
            $result = ltrim( substr($query, 5), '/' );
            unset($_GET['path']);
            $params = UrlHelper::GetParams( $query );
            if ( !empty($params) )
            {
                $_GET = array_merge($_GET, $params);
            }
            $_REQUEST = array_merge($_REQUEST, $_GET, $_POST);        
        }
        return $result;
    }

//    Timer::Stop("page_load");

?>
